package main.Q2401_2500;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Q2491_2500 {
    public static void main(String[] args) {
        System.out.println("Question2491：");
        System.out.println("Question2492：");
        System.out.println("Question2493：");
        System.out.println("Question2494：");
        System.out.println("Question2495：");
        System.out.println("Question2496：");
        System.out.println("Question2497：");
        System.out.println("Question2498：");
        System.out.println("Question2499：");
        System.out.println("Question2500：删除每行中的最大值");
    }
}

class Question2500 {
    public int deleteGreatestValue(int[][] grid) {
        int m = grid.length, n = grid[0].length;
        for (int i = 0; i < m; i++) {
            Arrays.sort(grid[i]);
        }
        int result = 0;
        for (int j = 0; j < n; j++) {
            int max = 0;
            for (int i = 0; i < m; i++) {
                max = Math.max(max, grid[i][j]);
            }
            result += max;
        }
        return result;
    }
}